package jmine.tec.web.front.sample.filler;

import jmine.tec.web.front.dispatcher.request.BackOfficeRequestFiller;
import jmine.tec.web.front.domain.BackOfficeRequest;
import jmine.tec.web.front.sample.SampleFormTypeInformation;
import jmine.tec.web.front.sample.extensions.rs.SampleForm;

/**
 * Sample custom filler
 * 
 * @author lundberg
 */
public class BackOfficeRequestSampleFiller implements BackOfficeRequestFiller<SampleForm> {

    /**
     * {@inheritDoc}
     */
    public void fill(BackOfficeRequest request, SampleForm form) {
        request.setType(SampleFormTypeInformation.TYPE_IDENTIFIER);
        request.addRequestValue(SampleFormTypeInformation.STRING_PROPERTY_IDENTIFIER, form.getImportantString());
        request.addRequestValue(SampleFormTypeInformation.NUMBER_PROPERTY_IDENTIFIER, form.getImportantNumber());
        request.addRequestValue(SampleFormTypeInformation.DATE_PROPERTY_IDENTIFIER, form.getImportantDate());
    }
}
